import Taro from '@tarojs/taro';
import React, {Component} from 'react';
import {View, Text} from '@tarojs/components';
import './form-item.less';
export interface IFormItemProps {
  labelName?: string;
  placeholder?: string;
  // 输入框样式
  textStyle?: Object;
  leftStyle?: Object;
  styles?: Object;
}

/**
 * form中普通展示项
 */
export default class FormItem extends Component<IFormItemProps, any> {
  constructor(props: IFormItemProps) {
    super(props);
  }

  render() {
    const {labelName, placeholder, textStyle, leftStyle, styles} = this.props;
    return (
      <View className="form-item flex-start-item" style={styles}>
        <Text className="form-text" style={leftStyle}>
          {labelName}
        </Text>
        <View className="form-context2">
          <Text className="select-text" style={textStyle}>
            {placeholder}
          </Text>
        </View>
      </View>
    );
  }
}
